class Solution {
    public:
        vector<int> path;
        vector<vector<int>> v;
        vector<vector<int>> subsets(vector<int>& nums) {
            dfs(nums,0);
            return v;
        }
        void dfs(vector<int>&nums ,int i){
            v.push_back(path);
            for(int j = i ; j < nums.size() ; j++){
                path.push_back(nums[j]);
                dfs(nums,j+1);
                path.pop_back();
            }
        }
    };